# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AlertCenter.V1beta1.Model.GmailMessageInfo do
  @moduledoc """
  Details of a message in phishing spike alert.

  ## Attributes

  *   `attachmentsSha256Hash` (*type:* `list(String.t)`, *default:* `nil`) - The `SHA256` hash of email's attachment and all MIME parts.
  *   `date` (*type:* `DateTime.t`, *default:* `nil`) - The date of the event related to this email.
  *   `md5HashMessageBody` (*type:* `String.t`, *default:* `nil`) - The hash of the message body text.
  *   `md5HashSubject` (*type:* `String.t`, *default:* `nil`) - The MD5 Hash of email's subject (only available for reported emails).
  *   `messageBodySnippet` (*type:* `String.t`, *default:* `nil`) - The snippet of the message body text (only available for reported emails).
  *   `messageId` (*type:* `String.t`, *default:* `nil`) - The message ID.
  *   `recipient` (*type:* `String.t`, *default:* `nil`) - The recipient of this email.
  *   `sentTime` (*type:* `DateTime.t`, *default:* `nil`) - The sent time of the email.
  *   `subjectText` (*type:* `String.t`, *default:* `nil`) - The email subject text (only available for reported emails).
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :attachmentsSha256Hash => list(String.t()) | nil,
          :date => DateTime.t() | nil,
          :md5HashMessageBody => String.t() | nil,
          :md5HashSubject => String.t() | nil,
          :messageBodySnippet => String.t() | nil,
          :messageId => String.t() | nil,
          :recipient => String.t() | nil,
          :sentTime => DateTime.t() | nil,
          :subjectText => String.t() | nil
        }

  field(:attachmentsSha256Hash, type: :list)
  field(:date, as: DateTime)
  field(:md5HashMessageBody)
  field(:md5HashSubject)
  field(:messageBodySnippet)
  field(:messageId)
  field(:recipient)
  field(:sentTime, as: DateTime)
  field(:subjectText)
end

defimpl Poison.Decoder, for: GoogleApi.AlertCenter.V1beta1.Model.GmailMessageInfo do
  def decode(value, options) do
    GoogleApi.AlertCenter.V1beta1.Model.GmailMessageInfo.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AlertCenter.V1beta1.Model.GmailMessageInfo do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
